package c.d.a.a.b;

import android.graphics.Paint;
import android.util.DisplayMetrics;
import c.d.a.a.j.g;

/* compiled from: YAxis */
public class i extends a {
    public boolean A = true;
    public boolean B = true;
    public int C = -7829368;
    public float D = 1.0f;
    public float E = 10.0f;
    public float F = 10.0f;
    public b G = b.OUTSIDE_CHART;
    public a H;
    public float I = Float.POSITIVE_INFINITY;

    /* compiled from: YAxis */
    public enum a {
        LEFT,
        RIGHT
    }

    /* compiled from: YAxis */
    public enum b {
        OUTSIDE_CHART,
        INSIDE_CHART
    }

    public i(a aVar) {
        this.H = aVar;
        this.c = 0.0f;
    }

    public void a(float f, float f2) {
        if (Math.abs(f2 - f) == 0.0f) {
            f2 += 1.0f;
            f -= 1.0f;
        }
        float abs = Math.abs(f2 - f);
        f -= (abs / 100.0f) * this.F;
        this.y = f;
        abs = ((abs / 100.0f) * this.E) + f2;
        this.x = abs;
        this.z = Math.abs(f - abs);
    }

    public float e(Paint paint) {
        paint.setTextSize(this.d);
        String c = c();
        DisplayMetrics displayMetrics = g.a;
        float measureText = (this.b * 2.0f) + ((float) ((int) paint.measureText(c)));
        float f = this.I;
        if (f > 0.0f && f != Float.POSITIVE_INFINITY) {
            f = g.d(f);
        }
        if (((double) f) <= 0.0d) {
            f = measureText;
        }
        return Math.max(0.0f, Math.min(measureText, f));
    }

    public boolean f() {
        return this.a && this.s && this.G == b.OUTSIDE_CHART;
    }
}
